<template>
  <div class="wrap">
    <div class="fom">
      <h2>标题组管理</h2>
      <el-table :data="tags" width="100%" stripe border class="tab">
        <el-table-column type="selection"></el-table-column>
        <el-table-column
          type="index"
          label="编号"
          width="70px"
        ></el-table-column>
        <el-table-column prop="tagId" label="id"></el-table-column>
        <el-table-column
          prop="tagName"
          label="标题组名称"
          sortable
        ></el-table-column>
        <el-table-column label="管理">
          <el-button type="primary">修改</el-button>
          <el-button type="success">删除</el-button>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: "Tags",
  data() {
    return {
      tags: [],
    };
  },
  created() {
    var th = this;
    this.$axios
      .get("https://114.55.145.59:8443/librarytag/tag")
      .then((result) => {
        var x = [];
        for (let i = 0; i < result.data.length; i++) {
          if (result.data[i].tagName != null) {
            x.push(result.data[i]);
          }
        }
        th.tags = x;
      })
      .catch((err) => {
        console.log(err);
      });
  },
};
</script>

<style>
.wrap .fom .tab {
  margin: 20px 0;
}
</style>
